import re
with open("read.txt", "r") as r:
    with open("write.txt", "w") as w:
        for line in r.readlines():
            if line=='\n':
                continue
            str_need = re.findall(r'private.*;\n', line)
            strs=re.split(' ',str_need[0])
            if strs[1]=='String':
                str = re.findall(r'ing (.*);\n', str_need[0])
            elif strs[1]=='Double':
                str = re.findall(r'ble (.*);\n', str_need[0])
            else:
                str = re.findall(r'ger (.*);\n', str_need[0])

            #生成括号内需要的字符串，并用小括号包裹
            str1 = '\"' + str[0] + '\"'+': \"1\",'+"\n"
            #将小括号直接替换为包含小括号的字符串
            w.write(str1)